-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: Parser warning message when <gazebo> reference does not exist in URDF #1392
base: sdf14
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you check the diff, the indentation in your changes is very wierd. Do you mind to fix it ?
22e332a
to
e538eb2
Compare
Hi, I took a look at it—I think there was something wrong with my text editor, it showed a different output and I hadn't noticed earlier. Let me fix it now. |
Ok, sorry about the many commits—I think the formatting should be fixed now. I'll make sure everything fits with rigorously with |
Signed-off-by: Aditya Agrawal <[email protected]>
Signed-off-by: Aditya Agrawal <[email protected]>
Signed-off-by: Aditya Agrawal <[email protected]> Signed-off-by: Aditya Agrawal <[email protected]>
Signed-off-by: Aditya Agrawal <[email protected]> Signed-off-by: Aditya Agrawal <[email protected]>
Signed-off-by: Aditya Agrawal <[email protected]> Signed-off-by: Aditya Agrawal <[email protected]>
ab47435
to
2d221fe
Compare
@traversaro would you be able to take a look at this? |
Thanks @aagrawal05 ! I guess it could make sense to do something similar with joints as well, but even just with links this PR is already quite useful. |
Thanks @traversaro, I will take a look into it. Please let me know if anything further is to be done. |
@aagrawal05 did you mean to close this PR? |
Whoops yeah sorry, I must have clicked the wrong button! |
Ok I've added the other extensions and tests, please take a look. |
Signed-off-by: Aditya Agrawal <[email protected]>
58b71c9
to
d610aa9
Compare
Signed-off-by: Aditya Agrawal <[email protected]>
Ok all the above changes should be addressed—I was mistaken about how the reference works. This passes all the tests now and should be ready. Please let me know if anything further is needed, @azeey. |
Signed-off-by: Aditya Agrawal <[email protected]>
sdf::ParserConfig config; | ||
parser.InitModelString(str, config, &sdfResult); | ||
|
||
EXPECT_PRED2(sdf::testing::contains, buffer.str(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment here why the two link1
s are not the same? I believe the і
(https://www.compart.com/en/unicode/U+0456) in <gazebo reference="lіnk1">
is the issue.
parser.InitModelString(str, config, &sdfResult); | ||
|
||
EXPECT_PRED2(sdf::testing::contains, buffer.str(), | ||
"<link> tag reference[link1] does not exist" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the error message reference visual1
?
"<link> tag reference[link1] does not exist" | |
"<link> tag reference[visual1] does not exist" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep looking into this. I'be tried using _elem->Attribute("name")
but that doesn't give it either-often giving the link or something different. Similarly the sdfVisualName
doesn't seem correct. I'm tracing the code to see if there's an easy way to get the refString
from parseURDF but it's taking a bit longer because of my unfamiliarity with the codebase. Please let me know if my approach is correct.
parser.InitModelString(str, config, &sdfResult); | ||
|
||
EXPECT_PRED2(sdf::testing::contains, buffer.str(), | ||
"<link> tag reference[link1] does not exist" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"<link> tag reference[link1] does not exist" | |
"<link> tag reference[collision1] does not exist" |
sdf::ParserConfig config; | ||
parser.InitModelString(str, config, &sdfResult); | ||
|
||
EXPECT_PRED2(sdf::testing::contains, buffer.str(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you comment why the two joint1
s are different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some syntax errors in the URDF.
<box> | ||
<size>1 1 1</size> | ||
</box> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<box> | |
<size>1 1 1</size> | |
</box> | |
<box size="1 1 1"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, will add to next commit
<size>1 1 1</size> | ||
</box> | ||
</geometry> | ||
<material> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<material> | |
<material name="mat1"> |
"<joint> tag reference[joint1] does not exist" | ||
" in the URDF model. Please ensure that the reference attribute" | ||
" matches the name of a joint."); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've noticed with this PR that even properly working URDFs print a warning message. Do you mind adding a test with a URDF that has a correct reference and check that there is no warning printed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep ran into this while addressing the previous point. Will do.
Apologies for the delay in resolving this PR. Finding a solution is taking longer than expected and I am currently traveling. I will try to push my changes by the end of this week. |
🎉 New feature
Closes #1372
Summary
Added functionality to emit a warning when a reference to a link does not exists by adding a check in the
InsertSDFExtensionLink
method.Test it
I've added the
ParseGazeboRefDoesntExistWarningMessage
test which adds the test case mentioned from #1372 with conflicting U+0069 and U+0456 characters.Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.